package server.service.impl;

import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Service;
import server.model.entity.Users;
import server.service.PermissionsService;

/**
 * 创建人:    xvzhe
 * 创建时间:
 * 修改时间:
 * 版本:      v1.0
 */
@Service
public class PermissionsServiceImpl implements PermissionsService {
    @Override
    public Boolean checkAdmin() {
        Users users = (Users) SecurityUtils.getSubject().getSession().getAttribute("Users");
        if (users.getRole().getId().equals("1")) {
            return true;
        } else {
            return false;
        }
    }
}
